package at.fhj.antesk.steamvaluecalc.data;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import at.fhj.antesk.steamvaluecalc.enums.Currency;


public class Price {

    private Double amount;
    private Currency currency;

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Currency getCurrency() {
        return currency;
    }

    public void setCurrency(Currency currency) {
        this.currency = currency;
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder() //
            .append(amount) //
            .append(currency) //
            .hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Price)) {
            return false;
        }

        Price other = (Price)obj;
        return new EqualsBuilder() //
            .append(amount, other.getAmount()) //
            .append(currency, other.getCurrency()) //
            .isEquals();
    }

    @Override
    public String toString() {
        return "Price [amount=" + amount + ", currency=" + currency + "]";
    }

}
